Aleksey Kladov [Tue, 13 Jun 2017 18:40:58 +0000 (21:40 +0300)]
Fix typos and reword slightly
Aleksey Kladov [Mon, 12 Jun 2017 22:24:50 +0000 (01:24 +0300)]
Blurb about Cargo inner workings
bors [Thu, 8 Jun 2017 16:19:04 +0000 (16:19 +0000)]
Auto merge of #4146 - alexcrichton:bump, r=alexcrichton
Bump to 0.21.0
We're working on the next version now!
Alex Crichton [Thu, 8 Jun 2017 16:08:01 +0000 (09:08 -0700)]
Bump to 0.21.0
We're working on the next version now!
bors [Thu, 8 Jun 2017 14:54:36 +0000 (14:54 +0000)]
Auto merge of #4145 - rust-lang:matklad-patch-1, r=alexcrichton
Fix flaky test
closes #4144.
Aleksey Kladov [Thu, 8 Jun 2017 14:41:31 +0000 (17:41 +0300)]
Fix flaky test
bors [Wed, 7 Jun 2017 19:40:14 +0000 (19:40 +0000)]
Auto merge of #4141 - Keruspe:master, r=alexcrichton
update git2
Fixes build with libressl
Marc-Antoine Perennou [Wed, 7 Jun 2017 19:35:27 +0000 (21:35 +0200)]
update git2
Fixes build with libressl
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
bors [Wed, 7 Jun 2017 18:06:32 +0000 (18:06 +0000)]
Auto merge of #4139 - Keruspe:master, r=alexcrichton
Include rustc version in metadata
Followup to #4134
Fixes https://github.com/rust-lang/rust/issues/42483
bors [Wed, 7 Jun 2017 17:31:32 +0000 (17:31 +0000)]
Auto merge of #4137 - tshepang:immutable, r=alexcrichton
binding does not need to be mutable
bors [Wed, 7 Jun 2017 16:37:40 +0000 (16:37 +0000)]
Auto merge of #4062 - huntiep:master, r=alexcrichton
Load local git name/email for cargo init
Fixes #3920
Marc-Antoine Perennou [Wed, 7 Jun 2017 15:53:23 +0000 (17:53 +0200)]
Include rustc version in metadata
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
bors [Wed, 7 Jun 2017 15:42:07 +0000 (15:42 +0000)]
Auto merge of #4138 - alexcrichton:fix-tests, r=alexcrichton
Fix tests on beta
Had a few usages of `-Z` leak out of the nightly channel.
Alex Crichton [Wed, 7 Jun 2017 15:37:50 +0000 (08:37 -0700)]
Fix tests on beta
Had a few usages of `-Z` leak out of the nightly channel.
Tshepang Lekhonkhobe [Wed, 7 Jun 2017 15:23:36 +0000 (17:23 +0200)]
binding does not need to be mutable
Hunter Praska [Wed, 7 Jun 2017 00:24:00 +0000 (19:24 -0500)]
Add test for local gitconf
bors [Mon, 5 Jun 2017 17:16:58 +0000 (17:16 +0000)]
Auto merge of #4126 - malbarbo:bump-jobserver, r=alexcrichton
Bump jobserver to 0.1.4
Marco A L Barbosa [Mon, 5 Jun 2017 17:15:40 +0000 (14:15 -0300)]
Bump jobserver to 0.1.4
bors [Mon, 5 Jun 2017 14:49:59 +0000 (14:49 +0000)]
Auto merge of #4118 - alexcrichton:hamt, r=matklad
Optimize a slew of Cargo internals
Cargo has historically had very little optimization applied to it. Despite that it's pretty speedy today but there's always a desire to be faster! I've noticed Cargo being particularly sluggish on projects like Servo and rust-lang/rust, so I started profiling and found quite a few low-hanging fruit!
This PR is a slew of optimizations across Cargo for various things found here and there. The banner optimizations are:
* Resolution with a lock file should be basically a noop in terms of execution time now. An optimization was done to avoid cloning `Context` unless necessary, and that basically means it doesn't get cloned now! As the number 1 source of slowdown in Cargo this is the biggest improvement.
* Lots of pieces in `resolve` are now `Rc<T>` for being more easily cloneable.
* `Summary` now internally contains an `Rc` like `Dependency`, making it much more quickly cloneable.
* `Registry` as a trait no longer returns a `Vec` but rather takes a closure to yield summaries up, removing lots of intermediate arrays.
* We no longer spawn a thread for all units of "fresh work", only when we're about to spawn a process.
Almost everything here was guided through profiling `./x.py build` on rust-lang/rust or `cargo build -p log` on Servo. Both of these stress "noop resolution" and the former also stresses noop builds.
Runs of `./x.py build` dropped from 4 to 2 seconds (with lots of low-hanging fruit still remaining in Cargo itself) and `cargo build -p log` dropped from 1.5s to 0.3s. Massif graphs showing Cargo's memory usage also show that the peak memory usage of Cargo in a noop build of Servo dropped from 300MB to 30MB during resolution.
I'm hoping that none of these optimizations makes the code less readable and/or understandable. There are no algorithmic improvements in this PR other than those transitively picked up by making clones cheaper and/or allocating less.
Alex Crichton [Mon, 5 Jun 2017 14:44:16 +0000 (07:44 -0700)]
Fix tests
Alex Crichton [Mon, 5 Jun 2017 14:22:38 +0000 (07:22 -0700)]
Remove the RefCell from `PackageRegistry`
Some choice refactoring makes it no longer necessary!
Alex Crichton [Sat, 3 Jun 2017 18:11:22 +0000 (11:11 -0700)]
Comment about `Clone` on Context
Alex Crichton [Sat, 3 Jun 2017 18:03:12 +0000 (11:03 -0700)]
Type alias `activations` to consolidate definition
Avoids duplicating tons of maps!
Alex Crichton [Sat, 3 Jun 2017 18:02:14 +0000 (11:02 -0700)]
Remove stray Registry impls
They're basically barely used now anyway.
Alex Crichton [Sat, 3 Jun 2017 00:25:33 +0000 (17:25 -0700)]
Avoid stack overflow when dropping RcList
Turn recursion into a loop
Alex Crichton [Sat, 3 Jun 2017 00:18:06 +0000 (17:18 -0700)]
Remove `Clone` for a struct we don't want cloned
It's super expensive to clone a `Resolve` and the resolution implementation no
longer needs to do so, let's remove the impl.
Alex Crichton [Sat, 3 Jun 2017 00:17:24 +0000 (17:17 -0700)]
Reorganize `PackageRegistry::query` a bit
Less branches and more intuitive flow.
Alex Crichton [Sat, 3 Jun 2017 00:13:52 +0000 (17:13 -0700)]
Remove DependencyInner as a public API
No need for it to be exposed any more, let's just use `Rc::make_mut`
judiciously.
Alex Crichton [Fri, 2 Jun 2017 16:31:44 +0000 (09:31 -0700)]
Cache `Context::target_filenames`
Relatively expensive to calculate, never changes, easy to add a cache!
Alex Crichton [Fri, 2 Jun 2017 16:15:11 +0000 (09:15 -0700)]
Don't spawn threads for fresh work
On "fresh" builds this ends up just wasting a lot of time!
Alex Crichton [Fri, 2 Jun 2017 15:58:08 +0000 (08:58 -0700)]
Remove more allocatoins in index querying
Removing some allocations arounds the stored hashes by having nested hash maps
instead of tuple keys. Also remove an intermediate array when parsing
dependencies through a custom implementation of `Deserialize`. While this
doesn't make this code path blazingly fast it definitely knocks it down in the
profiles below other higher-value targets.
Alex Crichton [Fri, 2 Jun 2017 14:21:50 +0000 (07:21 -0700)]
Cut down allocations in Display impls
Avoid unnecessary `String` allocations in hot paths that get run a lot for large
graphs.
Alex Crichton [Fri, 2 Jun 2017 13:57:43 +0000 (06:57 -0700)]
Optimize allocations in the registry index
Avoid some unnecessary clones, `to_vec`, etc. Not super optimizal but improves
the profile here regardless.
Alex Crichton [Fri, 2 Jun 2017 05:33:02 +0000 (22:33 -0700)]
Optimize the interface of `Registry`.
Previously all intermediate stages would create and return `Vec<Summary>`, but
this is a pretty costly operation once you start layering. Ideally we'd use an
iterator-based approach here but working with that in trait objects is
difficult, so this commit takes a closure-based approach to avoid all the
intermediate allocations that are thrown away.
Alex Crichton [Fri, 2 Jun 2017 14:00:17 +0000 (07:00 -0700)]
Try to not allocate when decoding registry json
There's a few keys we don't need owned versions of, so try using Serde's
zero-copy deserialization where we can.
Alex Crichton [Fri, 2 Jun 2017 13:59:16 +0000 (06:59 -0700)]
Use `Rc::make_mut` in `Dependency`
Follow the same pattern with `Summary`
Alex Crichton [Fri, 2 Jun 2017 13:59:04 +0000 (06:59 -0700)]
Make `Summary::clone` cheap with an inner `Rc`
This already happens in a few other places in Cargo (e.g. `Dependency`) and
`Summary` cloning turned up high in the profile, so let's make it cheaper.
Alex Crichton [Fri, 4 Nov 2016 00:18:48 +0000 (17:18 -0700)]
Optimize resolution by removing allocations
This commit is a relatively serious optimization pass of the resolution phase in
Cargo, targeted at removing as many allocations as possible from this phase.
Executed as an iterative loop this phase of Cargo can often be costly for large
graphs but it's run on every single build!
The main optimization here is to avoid cloning the context and/or pushing a
backtracking frame if there are no candidates left in the current list of
candidates. That optimizes a fast-path for crates with lock files (almost all of
them) and gets us to the point where cloning the context basically disappears
from all profiling.
bors [Sat, 3 Jun 2017 17:54:43 +0000 (17:54 +0000)]
Auto merge of #4119 - fabricedesre:patch-1, r=alexcrichton
Fix typo in argument name.
Fabrice Desré [Sat, 3 Jun 2017 01:51:09 +0000 (18:51 -0700)]
Fix typo in argument name.
bors [Fri, 2 Jun 2017 22:53:36 +0000 (22:53 +0000)]
Auto merge of #4110 - alexcrichton:jobserver, r=matklad
Add a GNU make jobserver implementation to Cargo
This commit adds a GNU make jobserver implementation to Cargo, both as a client
of existing jobservers and also a creator of new jobservers. The jobserver is
actually just an IPC semaphore which manifests itself as a pipe with N bytes
of tokens on Unix and a literal IPC semaphore on Windows. The rough protocol
is then if you want to run a job you read acquire the semaphore (read a byte on
Unix or wait on the semaphore on Windows) and then you release it when you're
done.
All the hairy details of the jobserver implementation are housed in the
`jobserver` crate on crates.io instead of Cargo. This should hopefully make it
much easier for the compiler to also share a jobserver implementation
eventually.
The main tricky bit here is that on Unix and Windows acquiring a jobserver token
will block the calling thread. We need to either way for a running job to exit
or to acquire a new token when we want to spawn a new job. To handle this the
current implementation spawns a helper thread that does the blocking and sends a
message back to Cargo when it receives a token. It's a little trickier with
shutting down this thread gracefully as well but more details can be found in
the `jobserver` crate.
Unfortunately crates are unlikely to see an immediate benefit of this once
implemented. Most crates are run with a manual `make -jN` and this overrides the
jobserver in the environment, creating a new jobserver in the sub-make. If the
`-jN` argument is removed, however, then `make` will share Cargo's jobserver and
properly limit parallelism.
Closes #1744
Alex Crichton [Tue, 30 May 2017 04:09:53 +0000 (21:09 -0700)]
Add a GNU make jobserver implementation to Cargo
This commit adds a GNU make jobserver implementation to Cargo, both as a client
of existing jobservers and also a creator of new jobservers. The jobserver is
actually just an IPC semaphore which manifests itself as a pipe with N bytes
of tokens on Unix and a literal IPC semaphore on Windows. The rough protocol
is then if you want to run a job you read acquire the semaphore (read a byte on
Unix or wait on the semaphore on Windows) and then you release it when you're
done.
All the hairy details of the jobserver implementation are housed in the
`jobserver` crate on crates.io instead of Cargo. This should hopefully make it
much easier for the compiler to also share a jobserver implementation
eventually.
The main tricky bit here is that on Unix and Windows acquiring a jobserver token
will block the calling thread. We need to either way for a running job to exit
or to acquire a new token when we want to spawn a new job. To handle this the
current implementation spawns a helper thread that does the blocking and sends a
message back to Cargo when it receives a token. It's a little trickier with
shutting down this thread gracefully as well but more details can be found in
the `jobserver` crate.
Unfortunately crates are unlikely to see an immediate benefit of this once
implemented. Most crates are run with a manual `make -jN` and this overrides the
jobserver in the environment, creating a new jobserver in the sub-make. If the
`-jN` argument is removed, however, then `make` will share Cargo's jobserver and
properly limit parallelism.
Closes #1744
bors [Thu, 1 Jun 2017 22:20:28 +0000 (22:20 +0000)]
Auto merge of #4117 - brson:vs2017, r=alexcrichton
Update gcc crate for MSVC 2017
This is just a slightly more correct version of the gcc crate, but shouldn't have any practical changes.
bors [Thu, 1 Jun 2017 21:07:58 +0000 (21:07 +0000)]
Auto merge of #4116 - alexcrichton:enotsupp, r=Mark-Simulacrum
Ignore ENOTSUP in file locking on Linux too
Apparently there are some filesystems that return this!
Closes #4096
Brian Anderson [Thu, 1 Jun 2017 21:01:17 +0000 (21:01 +0000)]
Update gcc crate for MSVC 2017
Alex Crichton [Thu, 1 Jun 2017 19:24:51 +0000 (12:24 -0700)]
Ignore ENOTSUP in file locking on Linux too
Apparently there are some filesystems that return this!
Closes #4096
bors [Thu, 1 Jun 2017 16:53:07 +0000 (16:53 +0000)]
Auto merge of #4038 - nisargthakkar:newBadgesAdd, r=alexcrichton
Updating doc to reflect new badges added
The badges added are:
Is it maintained: Resolution time
Is it maintained: Percentage of open issues
Codecov: Code coverage
Coveralls: Code coverage
bors [Wed, 31 May 2017 22:51:31 +0000 (22:51 +0000)]
Auto merge of #4090 - jluner:master, r=alexcrichton
Add error-chain errors.
Fixes #4209
Convert CargoResult, CargoError into an implementation provided by error-chain. The previous is_human machinery is mostly removed; now errors are displayed unless of the Internal kind, verbose mode will print all errors.
bors [Wed, 31 May 2017 21:23:36 +0000 (21:23 +0000)]
Auto merge of #4113 - alexcrichton:trim-travis, r=alexcrichton
Remove lots of dated configuration from this repo
Lots of data build stuff is still here from awhile ago when this repo was
producing Cargo binaries, but the rust-lang/rust repo is now responsible for all
these binaries and build configurations. We no longer need to produce artifacts
or have tons of cross-compiles as rust-lang/rust does all that work, instead
let's just test the likely-to-regress platforms and have rust-lang/rust take
care of the rest.
This commit:
* Deletes the old `configure` script and `Makefile`
* Rewrites `src/doc` management as a shell script
* Trims down Travis/AppVeyor configuration
Alex Crichton [Wed, 31 May 2017 19:55:47 +0000 (12:55 -0700)]
Remove lots of dated configuration from this repo
Lots of data build stuff is still here from awhile ago when this repo was
producing Cargo binaries, but the rust-lang/rust repo is now responsible for all
these binaries and build configurations. We no longer need to produce artifacts
or have tons of cross-compiles as rust-lang/rust does all that work, instead
let's just test the likely-to-regress platforms and have rust-lang/rust take
care of the rest.
This commit:
* Deletes the old `configure` script and `Makefile`
* Rewrites `src/doc` management as a shell script
* Trims down Travis/AppVeyor configuration
jluner [Wed, 31 May 2017 03:15:07 +0000 (22:15 -0500)]
Fixes review comments
Fix some formatting items.
Changes Internal error kind to preserve the original error.
Changes network retry logic to inspect full error chain for spurious
errors.
jluner [Sun, 28 May 2017 15:13:59 +0000 (10:13 -0500)]
Restore macro_use
jluner [Sun, 28 May 2017 04:50:55 +0000 (23:50 -0500)]
Resolve upstream updates to referenced crates
jluner [Sun, 28 May 2017 03:27:59 +0000 (22:27 -0500)]
Merge remote-tracking branch 'upstream/master'
jluner [Sun, 28 May 2017 03:24:40 +0000 (22:24 -0500)]
Fix formatting issue blocking build
bors [Sun, 28 May 2017 01:02:13 +0000 (01:02 +0000)]
Auto merge of #4107 - alexcrichton:update-deps, r=alexcrichton
Update a slew of dependencies and such
Standard bug fixes and otherwise keeping up to date
Alex Crichton [Sat, 27 May 2017 23:42:10 +0000 (16:42 -0700)]
Update a slew of dependencies and such
Standard bug fixes and otherwise keeping up to date
bors [Sat, 27 May 2017 23:36:45 +0000 (23:36 +0000)]
Auto merge of #4031 - torkleyy:exclude, r=alexcrichton
Add --exclude flag
Allows to exclude packages in conjunction
with --all.
Addresses #2878
torkleyy [Tue, 16 May 2017 17:44:05 +0000 (19:44 +0200)]
Fix build_all_exclude
by using with_stderr_contains because
parallel build may mix up the lines.
Additionally, remove the last line of
the benchmark.
torkleyy [Fri, 12 May 2017 13:44:15 +0000 (15:44 +0200)]
Add tests for --exclude
torkleyy [Fri, 12 May 2017 13:05:28 +0000 (15:05 +0200)]
Add exclude flag to bench, check and test
torkleyy [Fri, 12 May 2017 12:16:48 +0000 (14:16 +0200)]
Move package flag handling into cargo_compile
torkleyy [Thu, 11 May 2017 18:47:48 +0000 (20:47 +0200)]
Add --exclude flag
Allows to exclude packages in conjunction
with --all.
jluner [Sat, 27 May 2017 07:37:10 +0000 (02:37 -0500)]
Update gcc dependency to match updated gcc elsewhere in cargo
jluner [Sat, 27 May 2017 07:29:15 +0000 (02:29 -0500)]
Merge remote-tracking branch 'upstream/master'
jluner [Sat, 27 May 2017 07:21:48 +0000 (02:21 -0500)]
Fix failing tests
bors [Fri, 26 May 2017 17:30:08 +0000 (17:30 +0000)]
Auto merge of #4103 - brson:vs2017, r=alexcrichton
Update lockfile for gcc and cmake crates to pick up MSVC 2017 fixes
Seems to work.
Brian Anderson [Thu, 25 May 2017 18:58:47 +0000 (18:58 +0000)]
Update lockfile for gcc and cmake crates to pick up MSVC 2017 fixes
bors [Fri, 26 May 2017 14:05:10 +0000 (14:05 +0000)]
Auto merge of #4105 - birkenfeld:master, r=alexcrichton
Do not output "Blocking - waiting for lock" with -q
This is not an error, so it should not be printed unconditionally
to stderr. Since it can appear intermittently (e.g. due to editor
integration calling build every now and then) it will disturb
things that expect exact output from cargo (e.g. test suites).
Georg Brandl [Fri, 26 May 2017 08:07:29 +0000 (10:07 +0200)]
Do not output "Blocking - waiting for lock" with -q
This is not an error, so it should not be printed unconditionally
to stderr. Since it can appear intermittently (e.g. due to editor
integration calling build every now and then) it will disturb
things that expect exact output from cargo (e.g. test suites).
bors [Thu, 25 May 2017 16:50:10 +0000 (16:50 +0000)]
Auto merge of #4099 - matklad:ignore-root-target, r=alexcrichton
Ignore only root target directory
r? @alexcrichton
Aleksey Kladov [Thu, 25 May 2017 16:47:15 +0000 (19:47 +0300)]
Ignore only root target directory
We used to ignore all target directories, because it was common to
have multiple packages with different target directories in a single
repository. Now, when workspaces are here, such setups usually have a
single target, and we can .gitignore only it. It's useful because
sometimes you want to have a module named `target` in Rust.
If you use non-workspaced multi-package setup, you can create a
.gitignore with `/target/` for each package.
jluner [Thu, 25 May 2017 04:45:14 +0000 (23:45 -0500)]
Addresses review comments
* rebased
* removed `human` (deferring removing `internal` to a later PR)
* cargo_test.rs - fails on other error kinds
* unnecessary `map_err(CargoError::from)` removed
* fold NetworkError entirely into CargoError
* added justification comment for `extend_lifetime`
* various formatting goofs
The following tests are currently failing:
* `http_auth_offered`
* `custom_build_script_failed`
* `build_deps_for_the_right_arch`
* `dep_with_bad_submodule`
* `update_with_shared_deps`
* `finds_author_email`
* `finds_author_user`
* `finds_author_user_escaped`
* `finds_author_username`
* `finds_git_author`
* `exit_code`
bors [Thu, 25 May 2017 03:05:53 +0000 (03:05 +0000)]
Auto merge of #4098 - callahad:remove-superfluous-semis, r=alexcrichton
Remove superfluous `;;` sequences
Per @Mark-Simulacrum's request in https://github.com/rust-lang/rust/pull/42215#issuecomment-
303908683
Dan Callahan [Thu, 25 May 2017 03:01:02 +0000 (22:01 -0500)]
Remove superfluous `;;` sequences
jluner [Thu, 25 May 2017 02:15:22 +0000 (21:15 -0500)]
Merge branch 'master' of https://github.com/jluner/cargo
jluner [Wed, 24 May 2017 04:35:54 +0000 (23:35 -0500)]
Add error-chain errors
Convert CargoResult, CargoError into an implementation provided by error-chain. The previous is_human machinery is mostly removed; now errors are displayed unless of the Internal kind, verbose mode will print all errors.
bors [Wed, 24 May 2017 15:46:58 +0000 (15:46 +0000)]
Auto merge of #4088 - Nemikolh:buildscript-stderr, r=alexcrichton
Write stderr output from build-scripts next to stdout output
Closes #3462.
Please let me know if you want to change the file name for the error output. I originally thought that `stdout` and `stderr` would have been nice but I'm worried that changing `output` to `stdout` would cause breakage. So I choose the more conservative route.
jluner [Wed, 24 May 2017 04:35:54 +0000 (23:35 -0500)]
Add error-chain errors
Convert CargoResult, CargoError into an implementation provided by error-chain. The previous is_human machinery is mostly removed; now errors are displayed unless of the Internal kind, verbose mode will print all errors.
Nemikolh [Tue, 23 May 2017 17:06:43 +0000 (18:06 +0100)]
Mention the stderr file in the documentation.
Nemikolh [Tue, 23 May 2017 16:21:40 +0000 (17:21 +0100)]
Write stderr output from build-scripts to disk.
Closes #3462
bors [Mon, 22 May 2017 20:18:03 +0000 (20:18 +0000)]
Auto merge of #4085 - alexcrichton:fix-rewrite, r=matklad
Fix a serialization error on publish
In TOML we have to emit all keys before we emit all sub-tables, so to handle
that for dependencies just transform everything to an elaborated version.
Closes #4081
Alex Crichton [Mon, 22 May 2017 15:56:27 +0000 (08:56 -0700)]
Fix a serialization error on publish
In TOML we have to emit all keys before we emit all sub-tables, so to handle
that for dependencies just transform everything to an elaborated version.
Closes #4081
bors [Mon, 22 May 2017 15:30:03 +0000 (15:30 +0000)]
Auto merge of #4084 - shiver:issue-3360, r=alexcrichton
3360 - Allow for features to be either comma or space delimited.
This is my attempt at tackling issue #3360.
Hopefully I interpreted the original request correctly and this is what you were looking for.
Any suggestions you might have to improve the submission would be great.
Thanks!
Robert Vally [Mon, 22 May 2017 13:14:03 +0000 (21:14 +0800)]
3360 - Allow for features to be either comma or space delimited.
bors [Thu, 18 May 2017 19:05:20 +0000 (19:05 +0000)]
Auto merge of #3937 - andwur:rustc-flag-determinism, r=alexcrichton
Deterministic -L and --cfg flag ordering
This ensures that the `-L` and `--cfg` flags passed to `rustc` have stable ordering across runs.
It also does the same for `--cfg` flags passed to `rustdoc`.
Fixes #3895
Alex Crichton [Tue, 16 May 2017 15:11:23 +0000 (08:11 -0700)]
Only sort deps in build script dependency generation
bors [Thu, 18 May 2017 16:02:59 +0000 (16:02 +0000)]
Auto merge of #4069 - alexcrichton:remove-unused-dep, r=alexcrichton
Remove chrono as a dependency
Turns out we don't use it!
Alex Crichton [Thu, 18 May 2017 16:01:35 +0000 (09:01 -0700)]
Remove chrono as a dependency
Turns out we don't use it!
bors [Thu, 18 May 2017 09:34:53 +0000 (09:34 +0000)]
Auto merge of #4030 - alexcrichton:rewrite-cargo-toml, r=matklad
Rewrite Cargo.toml when packaging crates
This commit is an implementation of rewriting TOML manifests when we publish
them to the registry. The rationale for doing this is to provide a guarantee
that downloaded tarballs from crates.io can be built with `cargo build`
(literally). This in turn eases a number of other possible consumers of crates
from crates.io
* Vendored sources can now be more easily modified/checked as cargo build should
work and they're standalone crates that suffice for `path` dependencies
* Tools like cargobomb/crater no longer need to edit the manifest and can
instead perform regression testing on the literal tarballs they download
* Other systems such as packaging Rust code may be able to take advantage of
this, but this is a less clear benefit.
Overall I'm hesitatnt about this, unfortunately. This is a silent translation
happening on *publish*, a rare operation, that's difficult to inspect before it
flies up to crates.io. I wrote a script to run this transformation over all
crates.io crates and found a surprisingly large number of discrepancies. The
transformation basically just downloaded all crates at all versions,
regenerated the manifest, and then tested if the two manifests were (in memory)
the same.
Unfortunately historical Cargo had a critical bug which I think made this
exercise not too useful. Cargo used to *not* recreate tarballs if one already
existed, which I believe led to situations such as:
1. `cargo publish`
2. Cargo generates an error about a dependency. This could be that there's a
`version` not present in a `path` dependency, there could be a `git`
dependency, etc.
3. Errors are fixed.
4. `cargo publish`
5. Publish is successful
In step 4 above historical Cargo *would not recreate the tarball*. This means
that the contents of the index (what was published) aren't guaranteed to match
with the tarball's `Cargo.toml`. When building from crates.io this is ok as the
index is the source of truth for dependency information, but it means that *any*
transformation to rewrite Cargo.toml is impossible to verify against all crates
on crates.io (due to historical bugs like these).
I strove to read as many errors as possible regardless, attempting to suss out
bugs in the implementation here. To further guard against surprises I've updated
the verification step of packaging to work "normally" in these sense that it's
not rewriting dependencies itself or changing summaries. I'm hoping that this
serves as a good last-ditch effort that what we're about to publish will indeed
build as expected when uploaded to crates.io
Overall I'm probably 70% confident in this change. I think it's necessary to
make progress, but I think there are going to be very painful bugs that arise
from this feature. I'm open to ideas to help weed out these bugs ahead of time!
I've done what I can but I fear it may not be entirely enough.
Closes #4027
Alex Crichton [Thu, 11 May 2017 05:09:44 +0000 (22:09 -0700)]
Rewrite Cargo.toml when packaging crates
This commit is an implementation of rewriting TOML manifests when we publish
them to the registry. The rationale for doing this is to provide a guarantee
that downloaded tarballs from crates.io can be built with `cargo build`
(literally). This in turn eases a number of other possible consumers of crates
from crates.io
* Vendored sources can now be more easily modified/checked as cargo build should
work and they're standalone crates that suffice for `path` dependencies
* Tools like cargobomb/crater no longer need to edit the manifest and can
instead perform regression testing on the literal tarballs they download
* Other systems such as packaging Rust code may be able to take advantage of
this, but this is a less clear benefit.
Overall I'm hesitatnt about this, unfortunately. This is a silent translation
happening on *publish*, a rare operation, that's difficult to inspect before it
flies up to crates.io. I wrote a script to run this transformation over all
crates.io crates and found a surprisingly large number of discrepancies. The
transformation basically just downloaded all crates at all versions,
regenerated the manifest, and then tested if the two manifests were (in memory)
the same.
Unfortunately historical Cargo had a critical bug which I think made this
exercise not too useful. Cargo used to *not* recreate tarballs if one already
existed, which I believe led to situations such as:
1. `cargo publish`
2. Cargo generates an error about a dependency. This could be that there's a
`version` not present in a `path` dependency, there could be a `git`
dependency, etc.
3. Errors are fixed.
4. `cargo publish`
5. Publish is successful
In step 4 above historical Cargo *would not recreate the tarball*. This means
that the contents of the index (what was published) aren't guaranteed to match
with the tarball's `Cargo.toml`. When building from crates.io this is ok as the
index is the source of truth for dependency information, but it means that *any*
transformation to rewrite Cargo.toml is impossible to verify against all crates
on crates.io (due to historical bugs like these).
I strove to read as many errors as possible regardless, attempting to suss out
bugs in the implementation here. To further guard against surprises I've updated
the verification step of packaging to work "normally" in these sense that it's
not rewriting dependencies itself or changing summaries. I'm hoping that this
serves as a good last-ditch effort that what we're about to publish will indeed
build as expected when uploaded to crates.io
Overall I'm probably 70% confident in this change. I think it's necessary to
make progress, but I think there are going to be very painful bugs that arise
from this feature. I'm open to ideas to help weed out these bugs ahead of time!
I've done what I can but I fear it may not be entirely enough.
Closes #4027
bors [Wed, 17 May 2017 13:54:21 +0000 (13:54 +0000)]
Auto merge of #4065 - michaelwoerister:smarter-cargo-incremental, r=alexcrichton
Only compile user-modifiable projects incrementally.
Fixes #3972. Thanks for pointing me to the correct implementation, Alex!
r? @alexcrichton
Michael Woerister [Wed, 17 May 2017 12:14:41 +0000 (14:14 +0200)]
Only compile user-modifiable projects incrementally.
bors [Wed, 17 May 2017 01:33:51 +0000 (01:33 +0000)]
Auto merge of #4060 - alexcrichton:nobare, r=matklad
Don't use a bare checkout of the index
Both old and new Cargo share the same index, so be sure to maintain
compatibility by initializing a non-bare repository for the index. Note that
a nightly Cargo still won't check out the index, but when an older Cargo comes
along and tries to check it out then it'll work.
Closes #4058
bors [Tue, 16 May 2017 23:44:37 +0000 (23:44 +0000)]
Auto merge of #4055 - mersinvald:less-strict-libtest-tests, r=alexcrichton
Making tests less strict so they won't break on output changes
Required for https://github.com/rust-lang/rust/pull/41910
cc @Mark-Simulacrum
cc @alexcrichton
bors [Tue, 16 May 2017 22:16:09 +0000 (22:16 +0000)]
Auto merge of #3979 - hjr3:issue-3911, r=alexcrichton
Support glob syntax in workspace members
Fixes #3911
Hunter Praska [Tue, 16 May 2017 18:43:22 +0000 (13:43 -0500)]
Load local git name/email for cargo init
Fixes #3920
Alex Crichton [Tue, 16 May 2017 14:07:36 +0000 (07:07 -0700)]
Don't use a bare checkout of the index
Both old and new Cargo share the same index, so be sure to maintain
compatibility by initializing a non-bare repository for the index. Note that
a nightly Cargo still won't check out the index, but when an older Cargo comes
along and tries to check it out then it'll work.
Closes #4058
Andrew Watts [Fri, 21 Apr 2017 06:17:52 +0000 (15:47 +0930)]
Add test case for non-deterministic --cfg flags passed to rustc
Andrew Watts [Fri, 21 Apr 2017 06:11:01 +0000 (15:41 +0930)]
Fix non-deterministic --cfg feature flag list generation
The resolved features were returned in a HashSet and then iterated over,
which returns the feature names in arbitrary order.
See #3895